package com.daigoudao.web.dao;

import java.util.List;

import com.daigoudao.web.model.AddressModel;
import com.daigoudao.web.model.BillModel;
import com.daigoudao.web.model.OrderDetailModel;
import com.daigoudao.web.model.PurchaseRecord;
import com.daigoudao.web.model.TransInfoModel;

/**
 * 交易信息查询类
 * 
 * @author zheng
 * 
 */
public interface ITransInfoDao {

	public List<BillModel> queryBill(BillModel billModel) throws Exception;

	public int getBillCount(int brokerId) throws Exception;

	public List<BillModel> queryBillDetail(BillModel bill) throws Exception;

	public int getBillDetailCount(int brokerId) throws Exception;

	/**
	 * 更新交易状态
	 * 
	 * @param transInfoModel
	 * @throws Exception
	 */
	public void updateStatus(TransInfoModel transInfoModel) throws Exception;

	public TransInfoModel queryTran(String transId);

	public List<TransInfoModel> groupTransInfoByUser(int userId)
			throws Exception;

	public List<TransInfoModel> groupTransInfoByBroker(int userId)
			throws Exception;

	public String getLastTransId() throws Exception;

	public void addOrder(TransInfoModel order) throws Exception;

	public void addOrderDetails(List<OrderDetailModel> orderDetails)
			throws Exception;

	public void addAddress(AddressModel address) throws Exception;

	public TransInfoModel queryOrderDetail(TransInfoModel transInfoModel)
			throws Exception;

	/**
	 * 分页获取代购记录
	 * 
	 * @param page
	 *            分页对象
	 * @return
	 */
	public List<PurchaseRecord> queryPurchaseRecords(
			PurchaseRecord purchaseRecord) throws Exception;

	/**
	 * 获取代购记录数
	 * 
	 * @param productId
	 *            商品ID
	 * @return
	 */
	public int getPurhcaseRecordCount(PurchaseRecord purchaseRecord)
			throws Exception;

	public TransInfoModel getPayment(String tid) throws Exception;

	/**
	 * 查询订单记录
	 * 
	 * @param query
	 * @return
	 * @throws Exception
	 */
	public List<TransInfoModel> queryOrders(TransInfoModel query)
			throws Exception;

	/**
	 * 获取订单记录数
	 * 
	 * @param query
	 * @return
	 * @throws Exception
	 */
	public int getOrderCount(TransInfoModel query) throws Exception;
}
